@extends('backend.layouts.app')

@section('title', $title = '赔率盘口管理')

@section('breadcrumb')
    <a href="">系统设置</a>
    <a href="">集成系统</a>
    <a href="">{{$title}}</a>
@endsection

@section('content')
    <div class="layui-main">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>{{$title}}</legend>
        </fieldset>

        <form class="layui-form layui-form-pane" method="GET"
              action="{{ route('odds_handicap.index') }}">
            {{ csrf_field() }}
            <div class="layui-form-item" id="toolbarDemo">
                <div class=" layui-inline">
                    <label class="layui-form-label">平台编号</label>
                    <div class="layui-input-block">
                        <select name="main_game_plat_id" lay-verify="" lay-search="">
                            <option value="">请选择平台编号</option>
                            @foreach($plats as $plat)
                                <option value={{$plat->id}} @if($params['main_game_plat_id']==$plat->id) selected @endif>{{$plat->main_game_plat_name}}</option>
                            @endforeach
                        </select>
                    </div>
                </div>

                <button class=" layui-btn" lay-submit="" lay-filter="demo1">提交</button>
            </div>

        </form>
        <div class="layui-btn-group demoTable">
            <a href="{{ route('odds_handicap.create') }}" class="layui-btn">添加</a>
            <button class="layui-btn  layui-btn-danger" data-type="getCheckData"><i class="layui-icon"></i> 删除</button>
        </div>

        <div class="layui-form">
            @if($oddsHandicaps->count())
                <table class="layui-table" lay-filter="table"
                       lay-data="{id:'DeleteTable',totalRow: true,limit:{{$limit+1}},toolbar: 'default',defaultToolbar:['exports', 'print']}">
                    <thead>
                    <tr>
                        <th lay-data="{type:'checkbox', fixed: 'left'}">#</th>
                        <th lay-data="{field:'id', width:50, sort: true}">id</th>
                        <th lay-data="{field:'code', width:150,  sort: true}">盘口编号</th>
                        <th lay-data="{field:'main_game_plat_name',  width:100, sort: true}">游戏平台</th>
                        <th lay-data="{field:'plat_code', width:150,  sort: true}">平台盘口编号</th>
                        <th lay-data="{field:'odds_value',width:150,  sort: true}">赔率</th>
                        <th lay-data="{field:'description',width:150,  sort: true}">盘口描述</th>
                        <th lay-data="{field:'updated_at', width:170, sort: true}">修改时间</th>
                        <th lay-data="{field:'created_at', width:170, sort: true}">创建时间</th>
                        <th lay-data="{field:'cz', width:170, sort: true}">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($oddsHandicaps as $index => $oddsHandicap)
                        <tr>
                            <td></td>
                            <td>{{ $oddsHandicap->id }}</td>
                            <td>{{ $oddsHandicap->code  }}</td>
                            <td>{{ $oddsHandicap->plat->main_game_plat_name??''  }}</td>
                            <td>{{ $oddsHandicap->plat_code  }}</td>
                            <td>{{ $oddsHandicap->odds_value  }}</td>
                            <td>{{ $oddsHandicap->description  }}</td>
                            <td>{{ $oddsHandicap->updated_at  }}</td>
                            <td>{{ $oddsHandicap->created_at  }}</td>

                            <td>
                                <a href="{{ route('odds_handicap.edit', $oddsHandicap->id) }}"
                                   class="layui-btn layui-btn-sm layui-btn-normal">编辑</a>
                                <a href="javascript:;" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
                            </td>
                        </tr>
                    @endforeach

                    </tbody>
                </table>
                <div id="paginate-render"></div>
            @else
                <br/>
                <blockquote class="layui-elem-quote">暂无数据!</blockquote>
            @endif

        </div>
    </div>

@endsection

@section('scripts')
    @include('backend.layouts._paginate',[ 'count' => $oddsHandicaps->total(), 'delBatchUrl'=>route('odds_handicap.destroy'),'limit'=>$limit])
@endsection
